package com.streamhub.client;

import com.google.gwt.json.client.JSONObject;

/**
 * This interface should be implemented by classes wanting to receive updates on 
 * subscribed topics.  Listeners will receive updates after being added through one 
 * of the subscribe methods on {@link StreamHubGWTAdapter}.
 * 
 * @see StreamHubGWTAdapter#subscribe(String, StreamHubGWTUpdateListener)
 * @see StreamHubGWTAdapter#subscribe(String[], StreamHubGWTUpdateListener)
 */
public interface StreamHubGWTUpdateListener {

	/**
	 * The method that is called everytime an update is received on <code>topic</code>
	 * 
	 * @param topic		the topic on which the update was sent on
	 * @param update	the fields of the updated data
	 */
	void onUpdate(String topic, JSONObject update);
}
